/**
 * First we will load all of this project's JavaScript dependencies which
 * includes Vue and other libraries. It is a great starting point when
 * building robust, powerful web applications using Vue and Laravel.
 */
require('./bootstrap');

window.Vue = require('vue');

/**
 * Next, we will create a fresh Vue application instance and attach it to
 * the page. Then, you may begin adding components to this application
 * or customize the JavaScript scaffolding to fit your unique needs.
 */
import Vue from 'vue'
import App from './components/Hello.vue'
import router from './router/router.js'

/* 引入element-ui */
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)

//引入axios
import axios from 'axios'
Vue.prototype.$http= axios

//引入全局配置变量
import global from './config/global'
Vue.prototype.global = global;

//挂载公共方法
import base from './config/mothed'//引用
Vue.use(base);//将全局函数当做插件来进行注册

//挂载公共组件
import components from './publicComponents/'
Object.keys(components).forEach((key)=>{
  Vue.component(key,components[key]);
})

const app = new Vue({
    el: '#app',
    router,
    render: h=>h(App)
});